﻿@model IEnumerable<KRM.Core.tblKRMPaymentTransaction>

@{
    ViewBag.Title = "Payment History";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div style="padding-top: 15px">
    <fieldset>
        <legend>Payment History
        </legend>
        <form action="/home/paymenthistory" method="GET" id="frFilterPaymentHistory" style="margin: 0">
            <div class="row-fluid">

                <div class="span4">
                    <div class="row-fluid">
                        <div class="span4">
                            <input style="float: left;"  type="checkbox" name="FilterByDateFrom" id="FilterByDateFrom" value="1"  @(Request["FilterByDateFrom"] == "1" ? "checked=checked" : "")/>
                            <label class='inline' for="FilterByDateFrom">Date From</label>
                        </div>
                        <div class="span8">
                            <div id="datetimepicker2" class="input-append">
                                <input data-format="MM/dd/yyyy" type="text" name="dateFrom" placeholder="From" value="@(Request["dateFrom"] ?? DateTime.Now.ToString("MM/dd/yyyy"))" style="width: 88%">
                                <span class="add-on">
                                    <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="span4">
                    <div class="row-fluid">
                        <div class="span4">
                            <input style="float: left;" type="checkbox" name="FilterByDateTo"id="FilterByDateTo" value="1" @(Request["FilterByDateTo"] == "1" ? "checked=checked" : "")/>
                            <label class='inline' for="FilterByDateTo">Date To</label>
                        </div>
                        <div class="span8">
                            <div id="datetimepicker3" class="input-append">
                                <input data-format="MM/dd/yyyy" type="text" name="dateTo" placeholder="To" value="@(Request["dateTo"] ?? DateTime.Now.ToString("MM/dd/yyyy"))" style="width: 88%">
                                <span class="add-on">
                                    <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                                </span>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="span2">
                    <button type="submit" class="btn btn-primary">Search</button>
                </div>
            </div>

            <div class="row-fluid">
                <div class="span4">
                    <div class="row-fluid">
                        <div class="span4">
                            <label class='inline' for="SearchQuestions">Customer Name</label></div>
                        <div class="span8">

                            <input type="text" name="CustomerName" class="input-block-level" value="@Request["CustomerName"]">
                        </div>
                    </div>
                </div>
                <div class="span4">
                    <div class="row-fluid">
                        <div class="span4">
                            <label class='inline' for="SearchAnswers">Bill Post Code</label></div>
                        <div class="span8">
                            <input type="text" name="BillPostCode" class="input-block-level" value="@Request["BillPostCode"]">
                        </div>
                    </div>
                </div>
                <div class="span2">
                    <a href="/home/paymenthistory" class="btn">Clear</a>
                </div>
            </div>
            <div class="row-fluid">
                <div class="span4">
                    <div class="row-fluid">
                        <div class="span4">
                            <label class='inline' for="amount">Transaction Value</label></div>
                        <div class="span8">
                            <input type="text" name="amount" class="input-block-level" value="@Request["amount"]">
                        </div>
                    </div>
                </div>
                <div class="span4">
                    <div class="row-fluid">
                        <div class="span4">
                            <label class='inline' for="OrderRef">OrderRef</label>
                        </div>
                        <div class="span8">
                            <input type="text" name="OrderRef" class="input-block-level" value="@Request["OrderRef"]">
                        </div>
                    </div>
                </div>
            </div>
        </form>
    </fieldset>
    <div class="fieldset">
        <div class="legend">
            <span>Filter results</span>
        </div>
        <div style="height: 400px; overflow: auto">
            <table class="table table-bordered table-fix tbl-selected">
                <thead>
                    <tr>
                        <th>paymentTransactionID</th>
                        <th>paymentStatus</th>
                        <th>paymentType</th>
                        <th>orderType</th>
                        <th>orderref</th>
                        <th>transactionAmount</th>
                        <th>transactionStartDate</th>
                        <th>transactionCompleteDate</th>
                        <th>externalPaymentReference</th>
                        <th>CustomerID</th>
                        <th>Email</th>
                        <th>BillAdd1</th>
                        <th>BillPostcode</th>
                        <th>ShipAdd1</th>
                        <th>ShipPostcode</th>
                        <th>CustomerName</th>
                        <th>statusMessage</th>
                        <th>errorMessage</th>
                        <th>authCode</th>
                        <th>liabilityShift</th>
                        <th>purchaseDesc</th>
                        <th>browserHeaders</th>
                        <th>userIP</th>
                        <th>userAgent</th>
                        <th>CardPan</th>
                        <th>expiryDate</th>
                        <th>issueDate</th>
                        <th>issueNum</th>
                        <th>paymentApproved</th>
                        <th>ApprovedDate</th>
                        <th>ApprovedUser</th>
                        <th>AVSLineoneStatus</th>
                        <th>AVSPostcodeStatus</th>
                        <th>CV2Status</th>
                        <th>SecureMessage</th>
                        <th>lastUpdate</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in Model)
                    {
                        <tr>
                            <td>@item.paymentTransactionID</td>
                            <td>@item.paymentStatus</td>
                            <td>@item.paymentType</td>
                            <td>@item.orderType</td>
                            <td><a href="/orderview/orderdetail?OrderRef=@item.orderref" target="_blank">@item.orderref</a></td>
                            <td>@item.transactionAmount</td>
                            <td>@item.transactionStartDate</td>
                            <td>@item.transactionCompleteDate</td>
                            <td>@item.externalPaymentReference</td>
                            <td>@item.CustomerID</td>
                            <td>@item.Email</td>
                            <td>@item.BillAdd1</td>
                            <td>@item.BillPostcode</td>
                            <td>@item.ShipAdd1</td>
                            <td>@item.ShipPostcode</td>
                            <td>@item.CustomerName</td>
                            <td>@item.statusMessage</td>
                            <td>@item.errorMessage</td>
                            <td>@item.authCode</td>
                            <td>@item.liabilityShift</td>
                            <td>@item.purchaseDesc</td>
                            <td>@item.browserHeaders</td>
                            <td>@item.userIP</td>
                            <td>@item.userAgent</td>
                            <td>@item.CardPan</td>
                            <td>@item.expiryDate</td>
                            <td>@item.issueDate</td>
                            <td>@item.issueNum</td>
                            <td>@item.paymentApproved</td>
                            <td>@item.ApprovedDate</td>
                            <td>@item.ApprovedUser</td>
                            <td>@item.AVSLineoneStatus</td>
                            <td>@item.AVSPostcodeStatus</td>
                            <td>@item.CV2Status</td>

                            <td>@item.SecureMessage</td>
                            <td>@item.lastUpdate</td>
                        </tr>
                    }
                </tbody>
            </table>
        </div>
    </div>
</div>
